const path = require('path');
const RunPlugin = require('./plugins/RunPlugin.js');
const DonePlugin = require('./plugins/DonePlugin.js');

module.exports = {
  context: process.cwd(),
  devtool: false,
  mode: 'development',
  entry: {
    index: './src/main.js'
  },
  output: {
    filename: 'main.js', // 打包之后生成的文件名
    path: path.resolve(__dirname, 'dist')
  },
  module: {
    rules: [
      {
        test: /\.jsx?$/,
        exclude: /(node_modules)/,
        use: {
          loader: 'babel-loader',
          options: {
            presets: ['@babel/preset-env']
          }
        }
      }
    ]
  },
  plugins: [new RunPlugin(), new DonePlugin()],
  optimization: {},
  devServer: {}
}